using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;using THSERP.BusinessEntities;using THSERP.BaseProvider;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using THSLib;using THSERP.BaseProvider;

namespace THSERP.Modules.BranchStatistics
{
    public partial class guiPrintBranchSaleItemsStatistics : THSERPScreen
    {
        public guiPrintBranchSaleItemsStatistics()
        {
            InitializeComponent();
        }

        private void guiPrintBranchSaleItemsStatistics_Load(object sender, EventArgs e)
        {
            fld_dteDateFrom.DateTime = DateTime.Now;
            fld_dteDateTo.DateTime = fld_dteDateFrom.DateTime.AddDays(1);
            fld_cmbProductType.SelectedIndex = 0;
        }

        private void fld_btnPrint_Click(object sender, EventArgs e)
        {
            String strReportFileName = System.Windows.Forms.Application.StartupPath + "\\Reports\\" + Module.Name + "\\" + "BranchSaleItemsStatistics.rpt";
            ReportHelper.FileName = strReportFileName;
            Hashtable reportParams = new Hashtable();
            String strProductType;

            reportParams.Add("PrmFromDate", fld_dteDateFrom.DateTime.Date);
            reportParams.Add("PrmToDate", fld_dteDateTo.DateTime.Date);
            if (fld_cmbProductType.SelectedIndex == 0)
                strProductType = "Phone";
            else if (fld_cmbProductType.SelectedIndex == 1)
                strProductType = "SIM";
            else
                strProductType = "Component";
            reportParams.Add("PrmICProductType", strProductType);
            ReportHelper.DisplayReport(reportParams);
        }

        private void fld_btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}